import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:'/:pathMatch(.*)*',
      name:'BackHome',
      redirect:'/homeView'
    },
    {
      path: '/',
      name: 'home',
      redirect:'/homeView'
    },
    {
      path: '/homeView',
      name: 'HomeView',
      component: () => import('../views/homeView.vue'),
      meta:{
        des:'高德地图demo'
      }
    },
    {
      path: '/dragVideo',
      name: 'Video',
      component: () => import('../views/dragVideo.vue'),
      meta:{
        des:'页面小窗口拖拽'
      }
    },
    {
      path: '/drawMap',
      name: 'DrawMap',
      component: () => import('../views/drawMap.vue'),
      meta:{
        des:'高德地图api操作'
      }
    },
    {
      path: '/drawSwiper',
      name: 'DrawSwiper',
      component: () => import('../views/drawSwiper.vue'),
      meta:{
        des:'手写抖音轮播'
      }
    },
    {
      path: '/drawSvg',
      name: 'DrawSvg',
      component: () => import('../views/drawSvg.vue'),
      meta:{
        des:'svg基本操作'
      }
    },
    {
      path: '/webScanCode',
      name: 'WebScanCode',
      component: () => import('../views/webScanCode.vue'),
      meta:{
        des:'基于原生系统的扫码页面'
      }
    },
    {
      path: '/richText',
      name: 'RichText',
      component: () => import('../views/richText.vue'),
      meta:{
        des:'富文本插件'
      }
    },{
      path: '/customUI',
      name: 'CustomUI',
      component: () => import('../views/customUI.vue'),
      meta:{
        des:'页面布局，上不定数量筛选条件，下撑满空间表格+分页'
      }
    },{
      path: '/customTab',
      name: 'CustomTab',
      component: () => import('../views/customTab.vue'),
      meta:{
        des:'自定义实现一个tab切换栏'
      }
    },{
      path: '/buildingTree',
      name: 'BuildingTree',
      component: () => import('../views/buildingTree.vue'),
      meta:{
        des:'自定义实现建筑层级'
      }
    },{
      path: '/waterFlow',
      name: 'WaterFlow',
      component: () => import('../views/waterFlow.vue'),
      meta:{
        des:'css实现管道水流'
      }
    },{
      path: '/canvasDemo',
      name: 'CanvasDemo',
      component: () => import('../views/canvasDemo.vue'),
      meta:{
        des:'canvas绘图'
      }
    },{
      path: '/canvasProcess',
      name: 'CanvasProcess',
      component: () => import('../views/canvasProcess.vue'),
      meta:{
        des:'canvas实现自定义拓扑图'
      }
    },{
      path: '/customTable',
      name: 'CustomTable',
      component: () => import('../views/customTable.vue'),
      meta:{
        des:'表格合并行'
      }
    },{
      path: '/threeJs',
      name: 'threeJs',
      component: () => import('../views/threeJs.vue'),
      meta:{
        des:'threeJs市里全景'
      }
    },{
      path: '/dataEncryption',
      name: 'dataEncryption',
      component: () => import('../views/dataEncryption.vue'),
      meta:{
        des:'数据加密'
      }
    },{
      path: '/machineValidate',
      name: 'machineValidate',
      component: () => import('../views/machineValidate.vue'),
      meta:{
        des:'人机验证'
      }
    },{
      path: '/vueBase',
      name: 'vueBase',
      component: () => import('../views/vueBase.vue'),
      meta:{
        des:'VUE基础知识'
      }
    },{
      path: '/pugDemo',
      name: 'pugDemo',
      component: () => import('../views/pugDemo.vue'),
      meta:{
        des:'哈巴狗示例'
      }
    },{
      path: '/videoDemo',
      name: 'videoDemo',
      component: () => import('../views/videoDemo.vue'),
      meta:{
        des:'video.js示例'
      }
    },{
      path: '/popover',
      name: 'popover',
      component: () => import('../views/popover.vue'),
      meta:{
        des:'泡泡'
      }
    },{
      path: '/ElTransform',
      name: 'elTransform',
      component: () => import('../views/elTransform.vue'),
      meta:{
        des:'背景删除'
      }
    },{
      path: '/dragSort',
      name: 'dragSort',
      component: () => import('../views/dragSort.vue'),
      meta:{
        des:'拖拽排序'
      }
    },{
      path: '/echartsMap',
      name: 'echartsMap',
      component: () => import('../views/echartsMap.vue'),
      meta:{
        des:'地图图表'
      }
    },{
      path: '/canvasFlyLine',
      name: 'canvasFlyLine',
      component: () => import('../views/canvasFlyLine.vue'),
      meta:{
        des:'canvas飞线渐变效果'
      }
    },{
      path: '/threePiping',
      name: 'threePiping',
      component: () => import('../views/threePiping.vue'),
      meta:{
        des:'threejs绘制管道'
      }
    },{
      path: '/exportWord',
      name: 'exportWord',
      component: () => import('../views/exportWord.vue'),
      meta:{
        des:'导出word'
      }
    },{
      path: '/tableCalendar',
      name: 'tableCalendar',
      component: () => import('../views/tableCalendar.vue'),
      meta:{
        des:'tableCalendar表格日历'
      }
    },{
      path: '/deepseek',
      name: 'deepseek',
      component: () => import('../views/deepseek.vue'),
      meta:{
        des:'tableCalendar表格日历'
      }
    },{
      path: '/webAudio',
      name: 'webAudio',
      component: () => import('../views/webAudio.vue'),
      meta:{
        des:'浏览器获取音频'
      }
    },
  ]
})

router.beforeEach((to) => {
  // console.log('per',window.location.origin + to.fullPath,to.fullPath);
  document.title = to.meta.des
})

export default router
